package com.tjetc.dao;

import com.tjetc.entity.Province;
import com.tjetc.entity.Spot;
import org.apache.ibatis.annotations.Param;

import java.util.List;

public interface SpotMapper {
  Spot selectSpotById(Long spotId);
  List<Spot> selectAll();
  List<Spot> selectTopSpotsByCityAndDimension(@Param("cityId") Long cityId,
                                              @Param("dimension") String dimension,
                                              @Param("limit") int limit);

  List<Spot> selectTopSpotsByProvinceAndDimension(@Param("provinceId") Long provinceId,
                                                  @Param("dimension") String dimension,
                                                  @Param("limit") int limit);

  List<Spot> selectTop(Long l);
  Province findprovince(Long province_id);

  List<Spot> selectByCity(Long cityCode);
  
  // 添加访问量相关的方法
  List<Spot> selectTopByVisitorsCount(int limit);
  
  List<Spot> selectTopSpotsByCityAndVisitorsCount(@Param("cityId") Long cityId, 
                                                 @Param("limit") int limit);
  int incrementVisitorsCount(Long spotId);
  
  List<Spot> selectSpotsByCityWithFilters(
      @Param("cityCode") Long cityCode,
      @Param("type") String type,
      @Param("priceRange") String priceRange,
      @Param("rating") Integer rating,
      @Param("sortKey") String sortKey,
      @Param("sortDirection") String sortDirection,
      @Param("offset") int offset,
      @Param("limit") int limit
  );
  
  int countSpotsByCityWithFilters(
      @Param("cityCode") Long cityCode,
      @Param("type") String type,
      @Param("priceRange") String priceRange,
      @Param("rating") Integer rating
  );
  
  List<String> getSpotTypesByCity(@Param("cityCode") Long cityCode);

    Spot findSpotById(Long id);

    List<Spot> searchSpot(String s);
}
